package com.example.pceb.common;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.config.annotation.*;

@Configuration
@EnableWebSocket
public class WebSocketConfig implements WebSocketConfigurer {
    @Override
    public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
        registry.addHandler(new com.example.pceb.component.SignalWebSocketHandler(), "/ws/signal")
                .setAllowedOrigins("*"); // 允许跨域
    }
}
